<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <base href="#(basePath)"/>
  <title>报表列表 - 下载</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="static/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="static/admin.css" media="all">
</head>
<body>
  <div class="layui-fluid">
    <div class="layui-card">
      <div class="layui-form layui-card-header layuiadmin-card-header-auto">
        <div class="layui-form-item">
          <div class="layui-inline">
            <label class="layui-form-label">起始日期</label>
            <div class="layui-input-inline">
              <input type="text" name="settleDateStart" id="settleDateStart" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
            </div>
          </div>
          <div class="layui-inline">
            <label class="layui-form-label">结束日期</label>
            <div class="layui-input-inline">
              <input type="text" name="settleDateEnd" id="settleDateEnd" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
            </div>
          </div>
          <div class="layui-inline">
            <label class="layui-form-label">报表类型</label>
            <div class="layui-input-inline">
	            <select name="reportType" lay-filter="reportType">
	       			<option value="virtualBalance">虚账余额</option>
					<option value="income">总收入</option>
					<option value="share">分润</option>
					<option value="tradedetail">交易明细</option>
					<option value="epaylinks">epaylinks付款单</option>
	      		</select>
            </div>
          </div>
          <div class="layui-inline">
	    		<input type="button" lay-submit lay-filter="layuiadmin-app-form-submit" id="layuiadmin-app-form-submit" value="下载" class="layui-btn"/>	
          </div>
        </div>
      </div>
    </div>
  </div>

  <script src="static/layui/layui.js"></script>
  <script>
  layui.config({
    base: '#(basePath)' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'table', 'laydate'], function(){
	 var laydate = layui.laydate;
	   //日期时间选择器
	   laydate.render({
	     elem: '#settleDateStart'
	     ,type: 'date'
	   });
	   //日期时间选择器
	   laydate.render({
	     elem: '#settleDateEnd'
	     ,type: 'date'
	   });
    
	   var $ = layui.$
		,form = layui.form;
	    
	    //监听提交
	    form.on('submit(layuiadmin-app-form-submit)', function(data){
	      var field = data.field; //获取提交的字段
	      window.location.href =layui.setter.base+"admin/clearing/report/download?settleDateStart="
	    		  +field.settleDateStart
	    		  +"&settleDateEnd="+field.settleDateEnd
	    		  +"&reportType="+field.reportType
	    });
    	    
  });
  </script>
</body>
</html>